﻿namespace Vinno.WMS.Pack.Core
{
    public interface IWmsService
    {
        #region WareHouse
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<WareHouse> WareHouses { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<WareHouseOutputDto>> FindWareHouseById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateWareHouses(params WareHouseInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateWareHouses(params WareHouseInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="ids">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteWareHouses(params Guid[] ids);

        #endregion

        #region WareHouseArea
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<WareHouseArea> WareHouseAreas { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<WareHouseAreaOutputDto>> FindWareHouseAreaById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateWareHouseAreas(params WareHouseAreaInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateWareHouseAreas(params WareHouseAreaInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="ids">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteWareHouseAreas(params Guid[] ids);

        #endregion

        #region WareHouseAreaPos
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<WareHouseAreaPos> WareHouseAreaPoss { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<WareHouseAreaPosOutputDto>> FindWareHouseAreaPosById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateWareHouseAreaPoss(params WareHouseAreaPosInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateWareHouseAreaPoss(params WareHouseAreaPosInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="ids">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteWareHouseAreaPoss(params Guid[] ids);

        #endregion

        #region MaterialCategory
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<MaterialCategory> MaterialCategorys { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<MaterialCategoryOutputDto>> FindMaterialCategoryById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateMaterialCategorys(params MaterialCategoryInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateMaterialCategorys(params MaterialCategoryInputDto[] dtos);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="entity">实体信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateMaterialCategory(MaterialCategory entity);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity">实体信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateMaterialCategory(MaterialCategory entity);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="ids">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteMaterialCategorys(params Guid[] ids);

        #endregion

        #region IPN
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<IPN> IPNs { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<IPNOutputDto>> FindIPNById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateIPNs(params IPNInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateIPNs(params IPNInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="ids">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteIPNs(params Guid[] ids);

        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        Task<OperationResult> UpdateIPN(IPN entity);

        /// <summary>
        /// 审核操作
        /// </summary>
        Task<OperationResult> ApplyIPNHandler(Guid id, Status target);

        #endregion

        #region Material
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<Material> Materials { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<MaterialOutputDto>> FindMaterialById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateMaterials(params MaterialInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateMaterials(params MaterialInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="ids">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteMaterials(params Guid[] ids);

        #endregion

        #region MaterialInStorage
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<MaterialInStorage> MaterialInStorages { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<MaterialInStorageOutputDto>> FindMaterialInStorageById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dto">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateMaterialInStorage(MaterialInStorageInputDto dto);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateMaterialInStorages(params MaterialInStorageInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dto">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateMaterialInStorage(MaterialInStorageInputDto dto);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateMaterialInStorages(params MaterialInStorageInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteMaterialInStorage(Guid id);

        #endregion

        #region MaterialOutStorage
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<MaterialOutStorage> MaterialOutStorages { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<MaterialOutStorageOutputDto>> FindMaterialOutStorageById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dto">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateMaterialOutStorage(MaterialOutStorageInputDto dto);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateMaterialOutStorages(params MaterialOutStorageInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteMaterialOutStorage(Guid id);

        /// <summary>
        /// 审批操作
        /// </summary>
        Task<OperationResult> ApplyOutStorageHandler(Guid id, OutStorgeStatus target);

        #endregion
    }
}
